<h1>Module Reference</h1>
<div>A Shorty Code module is a web location which accepts a querystring parameter, and produces a text string result.</div>
<br />
<div>This is best explained with an example. Currently, the Shorty project has a shorty code called <a href="listing.php?arg=hap">--hap:</a>. This shorty code simply returns the word "happening". This is an example of a very simple shorty code. The source code for this example looks like this:</div>
<pre>
&lt;?php

echo "happening";

?&gt;
</pre>
<div>The source code is stored at a web address. If you wanted to create this module, and you had the domain http://www.boostpost.com, you might store it at the following URL: 
<pre>http://www.boostpost.com/modules/hap.php</pre>
 When the Shorty Project's engine called your module, it would add the "param" querystring parameter, which in this example is a blank string:
<pre>http://www.boostpost.com/modules/hap.php?param=</pre>
</div>
<div>Let's look at another example. In this case, a parameter will be passed in, and the code will return a result based on the input parameter. Currently in the Shorty project, there is a world time shorty code. The source code for that shorty code is:
<pre>
&lt;?php

	$moduleRequest = "";

	if (isset($_REQUEST['param']))
		$moduleRequest = $_REQUEST['param'];

	date_default_timezone_set($moduleRequest);
	echo date("g:i A");
?&gt;
</pre>
You can see from this example that the result being returned will depend on the value entered by the "param" querystring parameter.</div>
<br />
<h3>--nopost</h3>
<br />
<div>Module authors can return the value <strong>--nopost</strong> if the engine should not process the tweet. There are 2 key scenarios in which this return value is used: <strong>functional processing</strong>, and <strong>error handling</strong>.</div><br />
<div><strong>Functional Processing</strong>: If the module is performing a function, such as following a new twitter account, there is no tweet which should be posted. In this case, the module would return <strong>--nopost</strong> and the engine would not perform any further processing.</div><br />
<div><strong>Error Handling</strong>: If something happens which is unexpected during the execution of the module, the module may return <strong>--nopost</strong> to prevent bad data from being sent to Twitter.</div>